import request from "@/utils/request";

export default {
  all() {
    return request({
      url: `/airplane/all`,
      method: "get",
    });
  },
  list(currentPage, pageSize, search) {
    const searchParam = search || "_";
    return request({
      url: `/airplane/list/${currentPage}/${pageSize}/${searchParam}`,
      method: "get",
    });
  },
  total(search) {
    const searchParam = search || "_";
    return request({
      url: `/airplane/total/${searchParam}`,
      method: "get",
    });
  },
  add(data) {
    return request({
      url: `/airplane/add`,
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: `/airplane/update`,
      method: "post",
      data,
    });
  },
  delete(data) {
    return request({
      url: `/airplane/delete/${data}`,
      method: "post",
    });
  },
};
